home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / basic / ace24dist.lha / ace24.lha / include / graphics / Text.h < prev    next >
C/C++ Source or Header  |  1996-09-10  |  8KB  |  203 lines

  1. #ifndef GRAPHICS_TEXT_H
  2. #define GRAPHICS_TEXT_H 1
  3. /*
  4. ** text.h for ACE Basic
  5. **
  6. ** Note: Translated to ACE by ConvertC2ACE
  7. **       @ MapMeadow Software, Nils Sjoholm
  8. **
  9. **
  10. ** Date: 09/01/95
  11. **
  12. **
  13. */
  14.  
  15. /*
  16. ** This are the StructPointer defines for text.h
  17. */
  18. #ifndef ColorFontColorsPtr
  19. #define ColorFontColorsPtr ADDRESS
  20. #endif
  21. #ifndef ColorTextFontPtr
  22. #define ColorTextFontPtr ADDRESS
  23. #endif
  24. #ifndef TTextAttrPtr
  25. #define TTextAttrPtr ADDRESS
  26. #endif
  27. #ifndef TextAttrPtr
  28. #define TextAttrPtr ADDRESS
  29. #endif
  30. #ifndef TextExtentPtr
  31. #define TextExtentPtr ADDRESS
  32. #endif
  33. #ifndef TextFontPtr
  34. #define TextFontPtr ADDRESS
  35. #endif
  36. #ifndef TextFontExtensionPtr
  37. #define TextFontExtensionPtr ADDRESS
  38. #endif
  39. /*
  40. ** End of StructPointer defines for text.h
  41. */
  42.  
  43.  
  44.  
  45. #ifndef EXEC_PORTS_H
  46. #include    <exec/ports.h>
  47. #endif  /* EXEC_PORTS_H */
  48.  
  49. #ifndef GRAPHICS_GFX_H
  50. #include    <graphics/gfx.h>
  51. #endif  /* GRAPHICS_GFX_H */
  52.  
  53. #ifndef UTILITY_TAGITEM_H
  54. #include    <utility/tagitem.h>
  55. #endif  /* UTILITY_TAGITEM_H */
  56.  
  57. /*------ Font Styles ------------------------------------------------*/
  58. #define FS_NORMAL   0   /* normal text (no style bits set) */
  59. #define FSB_UNDERLINED  0   /* underlined (under baseline) */
  60. #define FSF_UNDERLINED  &H01
  61. #define FSB_BOLD    1   /* bold face text (ORed w/ shifted) */
  62. #define FSF_BOLD    &H02
  63. #define FSB_ITALIC  2   /* italic (slanted 1:2 right) */
  64. #define FSF_ITALIC  &H04
  65. #define FSB_EXTENDED    3   /* extended face (wider than normal) */
  66. #define FSF_EXTENDED    &H08
  67.  
  68. #define FSB_COLORFONT   6   /* this uses ColorTextFont structure */
  69. #define FSF_COLORFONT   &H40
  70. #define FSB_TAGGED  7   /* the TextAttr is really an TTextAttr,  */
  71. #define FSF_TAGGED  &H80
  72.  
  73. /*------ Font Flags -------------------------------------------------*/
  74. #define FPB_ROMFONT 0   /* font is in rom */
  75. #define FPF_ROMFONT &H01
  76. #define FPB_DISKFONT    1   /* font is from diskfont.library */
  77. #define FPF_DISKFONT    &H02
  78. #define FPB_REVPATH 2   /* designed path is reversed (e.g. left) */
  79. #define FPF_REVPATH &H04
  80. #define FPB_TALLDOT 3   /* designed for hires non-interlaced */
  81. #define FPF_TALLDOT &H08
  82. #define FPB_WIDEDOT 4   /* designed for lores interlaced */
  83. #define FPF_WIDEDOT &H10
  84. #define FPB_PROPORTIONAL 5  /* character sizes can vary from nominal */
  85. #define FPF_PROPORTIONAL &H20
  86. #define FPB_DESIGNED    6   /* size explicitly designed,  not constructed */
  87.                 /* note: if you do not set this bit in your */
  88.                 /* textattr,  then a font may be constructed */
  89.                 /* for you by scaling an existing rom or disk */
  90.                 /* font (under V36 and above). */
  91. #define FPF_DESIGNED    &H40
  92.     /* bit 7 is always clear for fonts on the graphics font list */
  93. #define FPB_REMOVED 7   /* the font has been removed */
  94. #define FPF_REMOVED (128)
  95.  
  96. /****** TextAttr node,  matches text attributes in RastPort **********/
  97. STRUCT TextAttr  
  98.     ADDRESS  ta_Name         /* name of the font */
  99.     SHORTINT   ta_YSize        /* height of the font */
  100.     BYTE    ta_Style        /* intrinsic font style */
  101.     BYTE    ta_Flags        /* font preferences and flags */
  102. END STRUCT 
  103.  
  104. STRUCT TTextAttr  
  105.     ADDRESS  tta_Name        /* name of the font */
  106.     SHORTINT   tta_YSize       /* height of the font */
  107.     BYTE    tta_Style       /* intrinsic font style */
  108.     BYTE    tta_Flags       /* font preferences and flags */
  109.     TagItemPtr  tta_Tags    /* extended attributes */
  110. END STRUCT 
  111.  
  112.  
  113. /****** Text Tags ***************************************************/
  114. #define TA_DeviceDPI    (1 OR TAG_USER)    /* Tag value is Point union: */
  115.                     /* Hi SHORTINT XDPI,  Lo SHORTINT YDPI */
  116.  
  117. #define MAXFONTMATCHWEIGHT  32767   /* perfect match from WeighTAMatch */
  118.  
  119.  
  120. /****** TextFonts node **********************************************/
  121. STRUCT TextFont  
  122.     _Message tf_Message   /* reply message for font removal */
  123.                 /* font name in LN    \    used in this */
  124.     SHORTINT   tf_YSize        /* font height        OR    order to best */
  125.     BYTE    tf_Style        /* font style         OR    match a font */
  126.     BYTE    tf_Flags        /* preferences and flags  /    request. */
  127.     SHORTINT   tf_XSize        /* nominal font width */
  128.     SHORTINT   tf_Baseline     /* distance from the top of BYTE to baseline */
  129.     SHORTINT   tf_BoldSmear    /* smear to affect a bold enhancement */
  130.  
  131.     SHORTINT   tf_Accessors    /* access count */
  132.  
  133.     BYTE    tf_LoChar       /* the first character described here */
  134.     BYTE    tf_HiChar       /* the last character described here */
  135.     ADDRESS    tf_CharData     /* the bit character data */
  136.  
  137.     SHORTINT   tf_Modulo       /* the row modulo for the strike font data */
  138.     ADDRESS    tf_CharLoc      /* ptr to location data for the strike font */
  139.                 /*   2 words: bit offset then size */
  140.     ADDRESS    tf_CharSpace    /* ptr to words of proportional spacing data */
  141.     ADDRESS    tf_CharKern     /* ptr to words of kerning data */
  142. END STRUCT 
  143.  
  144. /* unfortunately,  this needs to be explicitly typed */
  145. #define tf_Extension    tf_Message.mn_ReplyPort
  146.  
  147. /*----- tfe_Flags0 (partial definition) ----------------------------*/
  148. #define TE0B_NOREMFONT  0   /* disallow RemFont for this font */
  149. #define TE0F_NOREMFONT  &H01
  150.  
  151. STRUCT TextFontExtension    /* this structure is read-only */
  152.     SHORTINT   tfe_MatchWord       /* a magic cookie for the extension */
  153.     BYTE    tfe_Flags0          /* (system private flags) */
  154.     BYTE    tfe_Flags1          /* (system private flags) */
  155.     TextFontPtr  tfe_BackPtr    /* validation of compilation */
  156.     MsgPortPtr  tfe_OrigReplyPort   /* original value in tf_Extension */
  157.     TagItemPtr  tfe_Tags        /* Text Tags for the font */
  158.     ADDRESS   tfe_OFontPatchS         /* (system private use) */
  159.     ADDRESS   tfe_OFontPatchK         /* (system private use) */
  160.     /* this space is reserved for future expansion */
  161. END STRUCT 
  162.  
  163. /****** ColorTextFont node ******************************************/
  164. /*----- ctf_Flags --------------------------------------------------*/
  165. #define CT_COLORMASK    &H000F  /* mask to get to following color styles */
  166. #define CT_COLORFONT    &H0001  /* color map contains designer's colors */
  167. #define CT_GREYFONT &H0002  /* color map describes even-stepped */
  168.                 /* brightnesses from low to high */
  169. #define CT_ANTIALIAS    &H0004  /* zero background thru fully saturated BYTE */
  170.  
  171. #define CTB_MAPCOLOR    0   /* map ctf_FgColor to the rp_FgPen if it's */
  172. #define CTF_MAPCOLOR    &H0001  /* is a valid color within ctf_Low..ctf_High */
  173.  
  174. /*----- ColorFontColors --------------------------------------------*/
  175. STRUCT ColorFontColors  
  176.     SHORTINT   cfc_Reserved    /* *must* be zero */
  177.     SHORTINT   cfc_Count       /* number of entries in cfc_ColorTable */
  178.     ADDRESS   cfc_ColorTable  /* 4 bit per component color map packed xRGB */
  179. END STRUCT 
  180.  
  181. /*----- ColorTextFont ----------------------------------------------*/
  182. STRUCT ColorTextFont  
  183.     TextFont ctf_TF 
  184.     SHORTINT   ctf_Flags       /* extended flags */
  185.     BYTE    ctf_Depth       /* number of bit planes */
  186.     BYTE    ctf_FgColor     /* color that is remapped to FgPen */
  187.     BYTE    ctf_Low         /* lowest color represented here */
  188.     BYTE    ctf_High        /* highest color represented here */
  189.     BYTE    ctf_PlanePick   /* PlanePick ala Images */
  190.     BYTE    ctf_PlaneOnOff  /* PlaneOnOff ala Images */
  191.     ColorFontColorsPtr  ctf_ColorFontColors  /* colors for font */
  192.     STRING ctf_CharData SIZE 32  /*  8*SIZEOF(ADDRESS) */    /*pointers TO bit planes ala tf_CharData */
  193. END STRUCT 
  194.  
  195. /****** TextExtent node *********************************************/
  196. STRUCT TextExtent  
  197.     SHORTINT   te_Width        /* same as TextLength */
  198.     SHORTINT   te_Height       /* same as tf_YSize */
  199.     Rectangle te_Extent  /* relative to CP */
  200. END STRUCT 
  201.  
  202. #endif  /* GRAPHICS_TEXT_H */
  203.